package edu.ynu.se.xiecheng.achitectureclass.dao;

import edu.ynu.se.xiecheng.achitectureclass.common.dao.LogicDAO;
import edu.ynu.se.xiecheng.achitectureclass.entity.Item;
import edu.ynu.se.xiecheng.achitectureclass.entity.Shop;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;

@Repository
public interface ShopDao extends LogicDAO<Shop, Long> {
    @Query("SELECT s.ShopItems FROM Shop s WHERE s.id = :shopId")
    Collection<Item> getItems(@Param("shopId") Long shopId);
}